package com.gmail.at.dengtooling;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author Deng Tooling
 * @version 1.0
 * @see http://www.rfc-editor.org/rfc/rfc4251.txt
 */
public class Connection {
	private volatile static Connection instance = null;
	private String host = "216.194.70.6";
	private int port = 22;
	private List sessions = new ArrayList();

	private Connection() {
	}

	public static Connection getInstance() {
		if (instance == null) {
			synchronized (Connection.class) {
				if (instance == null) {
					instance = new Connection();
				}
			}
		}
		return instance;
	}

	public void addSession(Session session) {
		sessions.add(session);
	}

	/**
	 * @return the host
	 */
	public String getHost() {
		return host;
	}

	/**
	 * @param host
	 *            the host to set
	 */
	public void setHost(String host) {
		this.host = host;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}

	/**
	 * @param port
	 *            the port to set
	 */
	public void setPort(int port) {
		this.port = port;
	}

}
